<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- Title -->
    <title>Create User | Graindashboard UI Kit</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/img/favicon.ico">

    <!-- Template -->
    <link rel="stylesheet" href="/css/graindashboard.css">

    <style>
        body.has-sidebar .main {
            padding: 0 100px;
        }
    </style>
</head>

<body class="has-sidebar has-fixed-sidebar-and-header">
<main class="main">
    <div class="content">
        <div class="py-4 px-3 px-md-4">
            <div class="card mb-3 mb-md-4">
                <div class="card-body">
                    <!-- Breadcrumb -->
                    <nav class="d-none d-md-block" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="#">会员管理</a>
                            </li>
                            <li class="breadcrumb-item active" aria-current="page">新增会员</li>
                        </ol>
                    </nav>
                    <!-- End Breadcrumb -->

                    <div class="mb-3 mb-md-4 d-flex justify-content-between">
                        <div class="h3 mb-0">修改会员</div>
                    </div>


                    <!-- Form -->
                    <div>
                        <form action="/admins/update" method="post">
                            <div class="form-row">
                                <div class="form-group col-12 col-md-6">
                                    <label for="name">姓名</label>
                                    <input type="text" th:value="${u.name}" class="form-control" value="" id="name" name="name" placeholder="请输入您的姓名">
                                </div>
                                <div class="form-group col-12 col-md-6">
                                    <label for="idNumber">身份证号码</label>
                                    <input type="text" th:value="${u.idNumber}" class="form-control" value="" id="idNumber" name="idNumber" placeholder="请输入您的身份证号码">
                                </div>
                            </div>
                            <div class="form-row">

                                <div class="form-group col-12 col-md-6">
                                    <label for="phone">电话号码</label>
                                    <input type="text" th:value="${u.phone}" class="form-control" value="" id="phone" name="phone" placeholder="请输入您的电话号码">
                                </div>
                                <div class="form-group col-12 col-md-6">
                                    <label for="password">登录密码</label>
                                    <input type="text" th:value="${u.password}" class="form-control" value="" id="password" name="password" placeholder="请输入您的登录密码">
                                </div>
                            </div>
                            <div class="form-group" id="genderBox">
                                <label style="margin-right: 40px;">性别</label>
                                <input type="radio" name="gender" value="男" th:checked="${u.gender == '男'}"> 男
                                <input type="radio" name="gender" style="margin-left: 20px;" value="女" th:checked="${u.gender == '女'}"> 女
                            </div>
                            <div style="display: none">
                                <input type="text" th:value="${u.id}" name="id">
                            </div>
                            <div class="float-right">
                                <a href="/admins/index" style="margin-left: 20px;">
                                    <button type="button" class="btn btn-secondary">Back</button>
                                </a>
                            </div>
                            <button type="submit" class="btn btn-primary float-right">Update</button>
                        </form>
                        <div th:if="${successMsg != null}" class="alert bg-success text-white alert-dismissible d-flex align-items-center p-md-4 mb-2 fade show" role="alert">
                            <i class="gd-check-box icon-text mr-2"></i>
                            <p class="mb-0">
                                <strong>Success</strong>
                                <span th:text="${successMsg}"></span>
                            </p>
                            <button type="button" class="close" aria-label="Close" data-dismiss="alert">
                                <i class="gd-close icon-text icon-text-xs" aria-hidden="true"></i>
                            </button>
                        </div>
                        <div class="alert bg-danger text-white alert-dismissible d-flex align-items-center p-md-4 mb-2 fade show" role="alert" th:if="${errorMsg != null}">
                            <i class="gd-alert icon-text mr-2"></i>
                            <p class="mb-0">
                                <strong>Error</strong>
                                <span th:text="${errorMsg}"></span>
                            </p>
                            <button type="button" class="close" aria-label="Close" data-dismiss="alert">
                                <i class="gd-close icon-text icon-text-xs" aria-hidden="true"></i>
                            </button>
                        </div>
                    </div>
                    <!-- End Form -->
                </div>
            </div>


        </div>

    </div>
</main>


<script src="/js/graindashboard.js"></script>
<script src="/js/graindashboard.vendor.js"></script>

</body>
</html>